﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 库存盘点基础输入参数
/// </summary>
public class InventoryBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 盘点单号
    /// </summary>
    public virtual string? InventoryCode { get; set; }
    
    /// <summary>
    /// 盘点结果
    /// </summary>
    public virtual string? InventoryOutcome { get; set; }
    
    /// <summary>
    /// 仓库名称ID
    /// </summary>
    public virtual long? InboundId { get; set; }
    
    /// <summary>
    /// 盘点类型
    /// </summary>
    public virtual int? InventoryType { get; set; }
    
    /// <summary>
    /// 盘点开始时间
    /// </summary>
    public virtual DateTime? InventoryBegin { get; set; }
    
    /// <summary>
    /// 盘点结束时间
    /// </summary>
    public virtual DateTime? InventoryEnd { get; set; }
    
    /// <summary>
    /// 入库状态
    /// </summary>
    public virtual int? StorageId { get; set; }
    
    /// <summary>
    /// 出库状态
    /// </summary>
    public virtual int? OutboundId { get; set; }
    
    /// <summary>
    /// 盘点货品
    /// </summary>
    public virtual string? InventoryGoods { get; set; }
    
    /// <summary>
    /// 盘点数量
    /// </summary>
    public virtual int? InventoryQuantity { get; set; }
    
    /// <summary>
    /// 盘盈数量
    /// </summary>
    public virtual int? InventorySurplus { get; set; }
    
    /// <summary>
    /// 盘亏数量
    /// </summary>
    public virtual int? NumberLosses { get; set; }
    
    /// <summary>
    /// 盘盈金额
    /// </summary>
    public virtual string? AmountProfit { get; set; }
    
    /// <summary>
    /// 经办人ID
    /// </summary>
    public virtual string? OrganizationalStructureId { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }
    
    /// <summary>
    /// 上传文件
    /// </summary>
    public virtual string? UpFile { get; set; }
    
}

/// <summary>
/// 库存盘点分页查询输入参数
/// </summary>
public class PageInventoryInput : BasePageInput
{
    /// <summary>
    /// 盘点单号
    /// </summary>
    public string? InventoryCode { get; set; }
    
    /// <summary>
    /// 盘点结果
    /// </summary>
    public string? InventoryOutcome { get; set; }
    
    /// <summary>
    /// 仓库名称ID
    /// </summary>
    public long? InboundId { get; set; }
    
    /// <summary>
    /// 盘点类型
    /// </summary>
    public int? InventoryType { get; set; }
    
    /// <summary>
    /// 盘点开始时间范围
    /// </summary>
     public DateTime?[] InventoryBeginRange { get; set; }
    
    /// <summary>
    /// 盘点结束时间范围
    /// </summary>
     public DateTime?[] InventoryEndRange { get; set; }
    
    /// <summary>
    /// 入库状态
    /// </summary>
    public int? StorageId { get; set; }
    
    /// <summary>
    /// 出库状态
    /// </summary>
    public int? OutboundId { get; set; }
    
    /// <summary>
    /// 盘点货品
    /// </summary>
    public string? InventoryGoods { get; set; }
    
    /// <summary>
    /// 盘点数量
    /// </summary>
    public int? InventoryQuantity { get; set; }
    
    /// <summary>
    /// 盘盈数量
    /// </summary>
    public int? InventorySurplus { get; set; }
    
    /// <summary>
    /// 盘亏数量
    /// </summary>
    public int? NumberLosses { get; set; }
    
    /// <summary>
    /// 盘盈金额
    /// </summary>
    public string? AmountProfit { get; set; }
    
    /// <summary>
    /// 经办人ID
    /// </summary>
    public string? OrganizationalStructureId { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }
    
    /// <summary>
    /// 上传文件
    /// </summary>
    public string? UpFile { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 库存盘点增加输入参数
/// </summary>
public class AddInventoryInput
{
    /// <summary>
    /// 盘点单号
    /// </summary>
    [MaxLength(32, ErrorMessage = "盘点单号字符长度不能超过32")]
    public string? InventoryCode { get; set; }
    
    /// <summary>
    /// 盘点结果
    /// </summary>
    [MaxLength(32, ErrorMessage = "盘点结果字符长度不能超过32")]
    public string? InventoryOutcome { get; set; }
    
    /// <summary>
    /// 仓库名称ID
    /// </summary>
    public long? InboundId { get; set; }
    
    /// <summary>
    /// 盘点类型
    /// </summary>
    public int? InventoryType { get; set; }
    
    /// <summary>
    /// 盘点开始时间
    /// </summary>
    public DateTime? InventoryBegin { get; set; }
    
    /// <summary>
    /// 盘点结束时间
    /// </summary>
    public DateTime? InventoryEnd { get; set; }
    
    /// <summary>
    /// 入库状态
    /// </summary>
    public int? StorageId { get; set; }
    
    /// <summary>
    /// 出库状态
    /// </summary>
    public int? OutboundId { get; set; }
    
    /// <summary>
    /// 盘点货品
    /// </summary>
    [MaxLength(32, ErrorMessage = "盘点货品字符长度不能超过32")]
    public string? InventoryGoods { get; set; }
    
    /// <summary>
    /// 盘点数量
    /// </summary>
    public int? InventoryQuantity { get; set; }
    
    /// <summary>
    /// 盘盈数量
    /// </summary>
    public int? InventorySurplus { get; set; }
    
    /// <summary>
    /// 盘亏数量
    /// </summary>
    public int? NumberLosses { get; set; }
    
    /// <summary>
    /// 盘盈金额
    /// </summary>
    [MaxLength(32, ErrorMessage = "盘盈金额字符长度不能超过32")]
    public string? AmountProfit { get; set; }
    
    /// <summary>
    /// 经办人ID
    /// </summary>
    [MaxLength(32, ErrorMessage = "经办人ID字符长度不能超过32")]
    public string? OrganizationalStructureId { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(32, ErrorMessage = "备注字符长度不能超过32")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 上传文件
    /// </summary>
    [MaxLength(64, ErrorMessage = "上传文件字符长度不能超过64")]
    public string? UpFile { get; set; }
    
}

/// <summary>
/// 库存盘点删除输入参数
/// </summary>
public class DeleteInventoryInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 库存盘点更新输入参数
/// </summary>
public class UpdateInventoryInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 盘点单号
    /// </summary>    
    [MaxLength(32, ErrorMessage = "盘点单号字符长度不能超过32")]
    public string? InventoryCode { get; set; }
    
    /// <summary>
    /// 盘点结果
    /// </summary>    
    [MaxLength(32, ErrorMessage = "盘点结果字符长度不能超过32")]
    public string? InventoryOutcome { get; set; }
    
    /// <summary>
    /// 仓库名称ID
    /// </summary>    
    public long? InboundId { get; set; }
    
    /// <summary>
    /// 盘点类型
    /// </summary>    
    public int? InventoryType { get; set; }
    
    /// <summary>
    /// 盘点开始时间
    /// </summary>    
    public DateTime? InventoryBegin { get; set; }
    
    /// <summary>
    /// 盘点结束时间
    /// </summary>    
    public DateTime? InventoryEnd { get; set; }
    
    /// <summary>
    /// 入库状态
    /// </summary>    
    public int? StorageId { get; set; }
    
    /// <summary>
    /// 出库状态
    /// </summary>    
    public int? OutboundId { get; set; }
    
    /// <summary>
    /// 盘点货品
    /// </summary>    
    [MaxLength(32, ErrorMessage = "盘点货品字符长度不能超过32")]
    public string? InventoryGoods { get; set; }
    
    /// <summary>
    /// 盘点数量
    /// </summary>    
    public int? InventoryQuantity { get; set; }
    
    /// <summary>
    /// 盘盈数量
    /// </summary>    
    public int? InventorySurplus { get; set; }
    
    /// <summary>
    /// 盘亏数量
    /// </summary>    
    public int? NumberLosses { get; set; }
    
    /// <summary>
    /// 盘盈金额
    /// </summary>    
    [MaxLength(32, ErrorMessage = "盘盈金额字符长度不能超过32")]
    public string? AmountProfit { get; set; }
    
    /// <summary>
    /// 经办人ID
    /// </summary>    
    [MaxLength(32, ErrorMessage = "经办人ID字符长度不能超过32")]
    public string? OrganizationalStructureId { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(32, ErrorMessage = "备注字符长度不能超过32")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 上传文件
    /// </summary>    
    [MaxLength(64, ErrorMessage = "上传文件字符长度不能超过64")]
    public string? UpFile { get; set; }
    
}

/// <summary>
/// 库存盘点主键查询输入参数
/// </summary>
public class QueryByIdInventoryInput : DeleteInventoryInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataInventoryInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 库存盘点数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportInventoryInput : BaseImportInput
{
    /// <summary>
    /// 盘点单号
    /// </summary>
    [ImporterHeader(Name = "盘点单号")]
    [ExporterHeader("盘点单号", Format = "", Width = 25, IsBold = true)]
    public string? InventoryCode { get; set; }
    
    /// <summary>
    /// 盘点结果
    /// </summary>
    [ImporterHeader(Name = "盘点结果")]
    [ExporterHeader("盘点结果", Format = "", Width = 25, IsBold = true)]
    public string? InventoryOutcome { get; set; }
    
    /// <summary>
    /// 仓库名称ID 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? InboundId { get; set; }
    
    /// <summary>
    /// 仓库名称ID 文本
    /// </summary>
    [ImporterHeader(Name = "仓库名称ID")]
    [ExporterHeader("仓库名称ID", Format = "", Width = 25, IsBold = true)]
    public string InboundFkDisplayName { get; set; }
    
    /// <summary>
    /// 盘点类型
    /// </summary>
    [ImporterHeader(Name = "盘点类型")]
    [ExporterHeader("盘点类型", Format = "", Width = 25, IsBold = true)]
    public int? InventoryType { get; set; }
    
    /// <summary>
    /// 盘点开始时间
    /// </summary>
    [ImporterHeader(Name = "盘点开始时间")]
    [ExporterHeader("盘点开始时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? InventoryBegin { get; set; }
    
    /// <summary>
    /// 盘点结束时间
    /// </summary>
    [ImporterHeader(Name = "盘点结束时间")]
    [ExporterHeader("盘点结束时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? InventoryEnd { get; set; }
    
    /// <summary>
    /// 入库状态
    /// </summary>
    [ImporterHeader(Name = "入库状态")]
    [ExporterHeader("入库状态", Format = "", Width = 25, IsBold = true)]
    public int? StorageId { get; set; }
    
    /// <summary>
    /// 出库状态
    /// </summary>
    [ImporterHeader(Name = "出库状态")]
    [ExporterHeader("出库状态", Format = "", Width = 25, IsBold = true)]
    public int? OutboundId { get; set; }
    
    /// <summary>
    /// 盘点货品
    /// </summary>
    [ImporterHeader(Name = "盘点货品")]
    [ExporterHeader("盘点货品", Format = "", Width = 25, IsBold = true)]
    public string? InventoryGoods { get; set; }
    
    /// <summary>
    /// 盘点数量
    /// </summary>
    [ImporterHeader(Name = "盘点数量")]
    [ExporterHeader("盘点数量", Format = "", Width = 25, IsBold = true)]
    public int? InventoryQuantity { get; set; }
    
    /// <summary>
    /// 盘盈数量
    /// </summary>
    [ImporterHeader(Name = "盘盈数量")]
    [ExporterHeader("盘盈数量", Format = "", Width = 25, IsBold = true)]
    public int? InventorySurplus { get; set; }
    
    /// <summary>
    /// 盘亏数量
    /// </summary>
    [ImporterHeader(Name = "盘亏数量")]
    [ExporterHeader("盘亏数量", Format = "", Width = 25, IsBold = true)]
    public int? NumberLosses { get; set; }
    
    /// <summary>
    /// 盘盈金额
    /// </summary>
    [ImporterHeader(Name = "盘盈金额")]
    [ExporterHeader("盘盈金额", Format = "", Width = 25, IsBold = true)]
    public string? AmountProfit { get; set; }
    
    /// <summary>
    /// 经办人ID
    /// </summary>
    [ImporterHeader(Name = "经办人ID")]
    [ExporterHeader("经办人ID", Format = "", Width = 25, IsBold = true)]
    public string? OrganizationalStructureId { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 上传文件
    /// </summary>
    [ImporterHeader(Name = "上传文件")]
    [ExporterHeader("上传文件", Format = "", Width = 25, IsBold = true)]
    public string? UpFile { get; set; }
    
}
